<template>
  <div class="user">
    <div class="top">
      <div class="right">
        <img v-lazy="userList.avatarUrl"
             class="img-180">
      </div>
      <div class="left">
        <div class="header">
          <p>{{ userList.nickname }}</p>
          <span></span>
          <span></span> <span v-if="userList.gender==2"
                class="gender1 gender">
            <svg class="icon cc"
                 aria-hidden="true">
              <use xlink:href="#icon-nv1"></use>
            </svg></span>
          <span v-if="userList.gender==1"
                class="gender">
            <svg class="icon cc"
                 aria-hidden="true">
              <use xlink:href="#icon-nan"></use>
            </svg>
          </span>
          <button></button>
        </div>
        <div class="buttom">
          <div class="xinxi">
            <span></span>
            <span></span>
            <span></span>
          </div>
          <span></span>
          <span></span>
          <span></span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex';
export default {
  data () {
    return {
      userList: [],//用户信息
    }
  },
  mounted () {
    this.getAcount()
  },
  computed: {
    ...mapState({
      isLogin: (state) => {
        return state.user.isLogin
      }
    })
  },
  methods: {
    getAcount () {
      if (this.isLogin == false) {
        this.userList = JSON.parse(localStorage.getItem('getAcount'))
      } else {
        return
      }
    }
  }
}
</script>

<style scoped lang="less">
.user {
  margin-left: 30px;
  .top {
    margin-top: 30px;
    display: flex;
    .right {
      display: flex;
      .img-180 {
        width: 180px;
        height: 180px;
        border-radius: 90px;
      }
    }
    .left {
      margin-left: 20px;
      display: flex;
      .header {
        p {
          font-weight: bold;
        }
      }
    }
  }
}
</style>